﻿Public Class testsearch
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        
    End Sub

    Protected Sub validateDate(ByVal sender As Object, ByVal e As EventArgs) Handles tb_Date.TextChanged
        Dim chosenDate As String = tb_Date.Text
        If chosenDate < Date.Today Then
            lblDateError.Text = "Date has already passed. Please choose a later date."
            lblDateError.CssClass = "showControl"
        Else
            lblDateError.CssClass = "hideControl"
        End If
    End Sub

    Protected Sub btn_SearchByName_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_SearchByName.Click
        Response.Redirect("SearchResults.aspx?name=" & tb_Name.Text)
    End Sub

    Protected Sub btn_SearchByDate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_SearchByDate.Click
        Response.Redirect("SearchResults.aspx?name=" & tb_Date.Text)
    End Sub

    Protected Sub btn_SearchByFaculty_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_SearchByFaculty.Click
        Response.Redirect("SearchResults.aspx?name=" & ddl_Faculty.SelectedIndex.ToString)
    End Sub
End Class